Security News
vlt Debuts New JavaScript Package Manager and Serverless Registry at NodeConf EU
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
postcss-resolve-nested-selector
Advanced tools
Given a (nested) selector in a PostCSS AST, return an array of resolved selectors.
Tested to work with the syntax of postcss-nested. Should also work with SCSS and Less syntax. If you'd like to help out by adding some automated tests for those, that'd be swell. In fact, if you'd like to add any automated tests, you are a winner!
If you want to resolve selectors in the same style as postcss-nesting you should instead use selector-resolve-nested
resolveNestedSelector(selector, node)
Returns an array of selectors resolved from selector
.
For example, given this JS:
var resolvedNestedSelector = require('postcss-resolve-nested-selector');
postcssRoot.eachRule(function(rule) {
rule.selectors.forEach(function(selector) {
console.log(resolvedNestedSelector(selector, rule));
});
});
And the following CSS:
.foo {
.bar {
color: pink;
}
}
This should log:
['.foo']
['.foo .bar']
Or with this CSS:
.foo {
.bar &,
a {
color: pink;
}
}
This should log:
['.foo']
['.bar .foo']
['.foo a']
FAQs
Resolve a nested selector in a PostCSS AST
The npm package postcss-resolve-nested-selector receives a total of 2,019,971 weekly downloads. As such, postcss-resolve-nested-selector popularity was classified as popular.
We found that postcss-resolve-nested-selector demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
Security News
Research
The Socket Research Team uncovered a malicious Python package typosquatting the popular 'fabric' SSH library, silently exfiltrating AWS credentials from unsuspecting developers.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.